<template>
  <div class="order fixed-top">
    <!-- 引入公共头部 -->
    <NavBar title="我的订单" fixed back url="/user"/>
    <van-tabs v-model="active" type = 'line' :swipe-threshold = 6 sticky @click="onClick" swipeable @change="onClick">
      <van-tab title="全部">
        <EmptyData text="您还没有相关订单" v-if="list.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.totalOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
          <ul v-for='item in list' :key="item.id">
            <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
            <span @click="toOrderDetail(item.orderId)">
              <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                <div>
                  <van-card
                    :num="itemChild.goodsNum"
                    :price="parseFloat(itemChild.payPrice).toFixed(2)"
                    :desc="itemChild.goodsProperty"
                    :title="itemChild.goodsName"
                    :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                    :thumb-link = "'#/item/detail?goodsId='+itemChild.goodsId"
                    :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                  />
                </div>
              </li>
              </span>
              <div slot="footer" align="right" >
                <div style="float:left; margin-top:5px; font-size: 12px" >
                  应付金额:{{item.payPrice}}
                </div>
                <van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status === 1">取消订单</van-button>
                <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                <van-button size="small" @click="confirmGoods(item)" v-if="item.status === 4">确认收货</van-button>
                <span v-if="item.status !== 4"><span v-if="item.status !== 3"><van-button  size="small"  @click="goDelete(item)" v-if="item.status !==1">删除订单</van-button></span></span>
                <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
              </div>
            </van-panel>
          </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
      <van-tab title="待付款">
        <EmptyData text="您还没有相关订单" v-if="forPayList.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.forPayOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
            <ul v-for='item in forPayList' :key="item.id">
              <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
                <span @click="toOrderDetail(item.orderId)">
                  <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                    <div>
                      <van-card
                        :num="itemChild.goodsNum"
                        :price="parseFloat(itemChild.payPrice).toFixed(2)"
                        :desc="itemChild.goodsProperty"
                        :title="itemChild.goodsName"
                        :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                        :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                      />
                    </div>
                  </li>
                </span>
                <div slot="footer" align="right" >
                  <div style="float:left; margin-top:5px; font-size: 12px" >
                    应付金额:{{item.payPrice}}
                  </div>
                  <van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status === 1">取消订单</van-button>
                  <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                  <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
                </div>
              </van-panel>
            </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
      <van-tab title="待发货">
        <EmptyData text="您还没有相关订单" v-if="forSendGoodsList.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.forSendOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
            <ul v-for='item in forSendGoodsList' :key="item.id">
              <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
                <span @click="toOrderDetail(item.orderId)">
                  <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                    <div>
                      <van-card
                        :num="itemChild.goodsNum"
                        :price="parseFloat(itemChild.payPrice).toFixed(2)"
                        :desc="itemChild.goodsProperty"
                        :title="itemChild.goodsName"
                        :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                        :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                      />
                    </div>
                  </li>
                </span>
                <div slot="footer" align="right" >
                  <div style="float:left; margin-top:5px; font-size: 12px" >
                    应付金额:{{item.payPrice}}
                  </div>
                  <van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status === 1">取消订单</van-button>
                  <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                  <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
                </div>
              </van-panel>
            </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
      <van-tab title="待收货"  status="4">
        <EmptyData text="您还没有相关订单" v-if="forReceiptGoodsList.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.forReceiptOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
            <ul v-for='item in forReceiptGoodsList' :key="item.id">
              <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
                <span @click="toOrderDetail(item.orderId)">
                  <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                    <div>
                      <van-card
                        :num="itemChild.goodsNum"
                        :price="parseFloat(itemChild.payPrice).toFixed(2)"
                        :desc="itemChild.goodsProperty"
                        :title="itemChild.goodsName"
                        :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                        :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                      />
                    </div>
                  </li>
                </span>
                <div slot="footer" align="right" >
                  <div style="float:left; margin-top:5px; font-size: 12px;" >
                    应付金额:{{item.payPrice}}
                  </div>
                  <van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status === 1">取消订单</van-button>
                  <van-button size="small" @click="confirmGoods(item)" v-if="item.status === 4">确认收货</van-button>
                  <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                  <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
                </div>
              </van-panel>
            </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
      <van-tab title="已完成">
        <EmptyData text="您还没有相关订单" style="height: 500px" class="empty-table" v-if="haveCompletedList.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.haveCompleteOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
            <ul v-for='item in haveCompletedList' :key="item.id">
              <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
                <span @click="toOrderDetail(item.orderId)">
                  <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                    <div>
                      <van-card
                        :num="itemChild.goodsNum"
                        :price="parseFloat(itemChild.payPrice).toFixed(2)"
                        :desc="itemChild.goodsProperty"
                        :title="itemChild.goodsName"
                        :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                        :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                      />
                    </div>
                  </li>
                </span>
                <div slot="footer" align="right" >
                  <div style="float:left; margin-top:5px; font-size: 12px;" >
                    应付金额:{{item.payPrice}}
                  </div>
                  <span v-if="item.status !== 2"><van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status !== 5">取消订单</van-button></span>
                  <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                  <van-button  size="small"  @click="goDelete(item)" v-if="item.status ===5">删除订单</van-button>
                  <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
                </div>
              </van-panel>
            </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
      <van-tab title="已取消">
        <EmptyData text="您还没有相关订单" class="empty-table" v-if="haveCancelList.length === 0"/>
        <van-list
          v-model="loading"
          :finished="finished.haveCancelOrderFinished"
          :offset="offset"
          @load="onLoad"
        >
          <van-pull-refresh v-model="isRefresh" @refresh="onRefresh">
            <ul v-for='item in haveCancelList' :key="item.id">
              <van-panel :title="'单号：'+ item.orderNum" :status="item.statusDes" class="order-panel">
                <span @click="toOrderDetail(item.orderId)">
                  <li v-for="itemChild in item.orderGoodsDetailRE" :key="itemChild.id">
                    <div>
                      <van-card
                        :num="itemChild.goodsNum"
                        :price="parseFloat(itemChild.payPrice).toFixed(2)"
                        :desc="itemChild.goodsProperty"
                        :title="itemChild.goodsName"
                        :thumb="GLOBAL.baseImagePath +itemChild.goodsUrl"
                        :origin-price="itemChild.isDiscount === 1 ? itemChild.goodsPrice : undefined"
                      />
                    </div>
                  </li>
                </span>
                <div slot="footer" align="right" >
                  <div style="float:left; margin-top:5px; font-size: 12px" >
                    应付金额:{{item.payPrice}}
                  </div>
                  <span v-if="item.status !== 2"><van-button size="small" @click="cancelOrder(item)" type="danger" v-if="item.status !== 5">取消订单</van-button></span>
                  <van-button  size="small"  @click="goPay(item)" v-if="item.status ===1">立即支付</van-button>
                  <van-button  size="small"  @click="goDelete(item)" v-if="item.status ===2">删除订单</van-button>
                  <van-button  size="small"  @click="goOnceBuy(item)" v-if="item.status !==1">再次购买</van-button>
                </div>
              </van-panel>
            </ul>
          </van-pull-refresh>
        </van-list>
      </van-tab>
    </van-tabs>
  </div>
</template>
<script>
import NavBar from '../../components/common/NavBar.vue'
import userApi from '../../api/order'
import detailAPI from '../../api/detail'
import EmptyData from '../../components/common/EmptyData.vue'
import { Dialog, Toast } from 'vant'
export default {
  name: 'order',
  data () {
    return {
      // 初始页码
      currentPage: {
        totalCurrentPage: 1,
        forPayCurrentPage: 1,
        forSendCurrentPage: 1,
        forReceiptCurrentPage: 1,
        haveCompleteCurrentPage: 1,
        haveCancelCurrentPage: 1
      },
      // 订单总数
      OrderNum: {
        totalOrderNum: 0,
        forPayOrderNum: 0,
        forReceiptOrderNum: 0,
        forSendOrderNum: 0,
        haveCompleteOrderNum: 0,
        haveCancelOrderNum: 0
      },
      // 页大小
      pageSize: 4,
      loading: false,
      finished: {
        totalOrderFinished: false,
        forPayOrderFinished: false,
        forReceiptOrderFinished: false,
        forSendOrderFinished: false,
        haveCompleteOrderFinished: false,
        haveCancelOrderFinished: false
      },
      isRefresh: false,
      offset: 1,
      active: 0,
      // 订单状态共5中
      orderStatus: 0,
      // 初始化订单数目
      totalOrderNum: 0,
      // 全部订单
      list: [],
      // 待付款订单
      forPayList: [],
      // 待发货订单
      forSendGoodsList: [],
      // 待收货订单
      forReceiptGoodsList: [],
      // 已完成订单
      haveCompletedList: [],
      // 已取消订单
      haveCancelList: [],
      disableOnLoad: true,
      disableOnRefresh: true
    }
  },
  methods: {
    toOrderDetail: function (orderId) {
      this.$router.push({path: '/user/orderDetail', query: {orderId: orderId}})
    },
    onLoad () {
      var _this = this
      // 异步更新数据
      if (this.disableOnLoad) {
        setTimeout(() => {
          _this.getOrderInfoList()
        }, 0)
      } else {
        this.disableOnLoad = true
      }
    },
    onClick (index) {
      var _this = this
      switch (index) {
        case 0:
          _this.orderStatus = index
          break
        case 1:
          _this.orderStatus = index
          break
        case 2:
          _this.orderStatus = 3
          break
        case 3:
          _this.orderStatus = 4
          break
        case 4:
          _this.orderStatus = 5
          break
        case 5:
          _this.orderStatus = 2
          break
      }
      if (_this.disableOnRefresh) {
        _this.onRefresh()
        _this.disableOnRefresh = false
      } else {
        _this.disableOnRefresh = true
      }
      this.disableOnLoad = false
    },
    onRefresh () {
      var _this = this
      Toast.loading({
        mask: true,
        duration: 1000,
        message: '加载中...'
      })
      setTimeout(() => {
        switch (_this.orderStatus) {
          case 0:
            _this.list.length = 0
            _this.currentPage.totalCurrentPage = 1
            break
          case 1:
            _this.forPayList.length = 0
            _this.currentPage.forPayCurrentPage = 1
            break
          case 2:
            _this.haveCancelList.length = 0
            _this.currentPage.haveCancelCurrentPage = 1
            break
          case 3:
            _this.forSendGoodsList.length = 0
            _this.currentPage.forSendCurrentPage = 1
            break
          case 4:
            _this.forReceiptGoodsList.length = 0
            _this.currentPage.forReceiptCurrentPage = 1
            break
          case 5:
            _this.haveCompletedList.length = 0
            _this.currentPage.haveCompleteCurrentPage = 1
            break
        }
        _this.getOrderInfoList()
        _this.disableOnRefresh = true
        _this.isRefresh = false
      }, 500)
    },
    // 再次购买
    goOnceBuy (item) {
      var _this = this
      var temp = []
      var itemChild = item.orderGoodsDetailRE
      for (var i = 0; i < itemChild.length; i++) {
        var proper = {
          goodsId: itemChild[i].goodsId,
          propertyId: itemChild[i].goodsPropertyId,
          num: itemChild[i].goodsNum,
          orderId: item.orderId
        }
        temp.push(proper)
        detailAPI.addCartgoods(proper.propertyId, proper.num)
        sessionStorage.setItem('goodsList', JSON.stringify(temp))
        sessionStorage.setItem('totalPrice', item.orderPrice)
      }
      var tempAddress = {
        receiver: item.receiptName,
        telephone: item.receiptTel,
        addrDetail: item.receiptAddress
      }
      _this.$router.push({path: '/cart/confirm', query: {tempAddress: tempAddress}})
    },
    // 立即支付
    goPay: function (item) {
      var _this = this
      var tempList = []
      var itemChild = item.orderGoodsDetailRE
      var orderId = item.orderId
      for (var i = 0; i < itemChild.length; i++) {
        var proper = {
          goodsId: itemChild[i].goodsId,
          propertyId: itemChild[i].goodsPropertyId,
          goodsNum: itemChild[i].goodsNum
        }
        tempList.push(proper)
      }
      var tempAddress = {
        receiptName: item.receiptName,
        receiptTel: item.receiptTel,
        receiptAddress: item.receiptAddress
      }
      sessionStorage.setItem('payGoodsList', JSON.stringify(tempList))
      sessionStorage.setItem('payTotalPrice', sessionStorage.getItem('totalPrice'))
      sessionStorage.setItem('orderId', orderId)
      sessionStorage.setItem('tempAddress', JSON.stringify(tempAddress))
      _this.$router.push('/cart/success')
    },
    goDelete: function (item) {
      var _this = this
      Dialog.confirm({
        title: '删除信息',
        message: '是否删除该订单信息',
        confirmButtonText: '删除',
        cancelButtonText: '返回'
      }).then(() => {
        userApi.goDelete(item.orderId).then(function (res) {
          if (res.data.success === true) {
            Toast.allowMultiple()
            Toast.loading({
              mask: true,
              duration: 0.3,
              message: '加载中...'
            })
            _this.onRefresh()
          } else {
            _this.onRefresh()
            Toast.loading({
              mask: true,
              duration: 1800,
              message: '加载中...'
            })
            Toast.fail('删除订单失败')
          }
        })
      }).catch(() => {
      })
    },
    cancelOrder: function (item) {
      var _this = this
      Dialog.confirm({
        title: '取消信息',
        message: '是否取消对当前订单',
        confirmButtonText: '确认取消',
        cancelButtonText: '返回'
      }).then(() => {
        userApi.cancelOrder(item.orderNum, item.status, item.orderId).then(function (res) {
          if (res.data.success === true) {
            let i
            switch (_this.orderStatus) {
              case 0:
                for (i = 0; i <= _this.list.length; i++) {
                  if (_this.list[i].orderName === item.orderName) {
                    item.status = 2
                    _this.onRefresh()
                    Toast.success('取消订单成功')
                    break
                  }
                }
                break
              case 1:
                for (i = 0; i <= _this.forPayList.length; i++) {
                  if (_this.forPayList[i].orderName === item.orderName) {
                    item.status = 2
                    _this.onRefresh()
                    Toast.success('取消订单成功')
                    break
                  }
                }
            }
          } else {
            _this.onRefresh()
            Toast.fail('取消订单失败')
          }
        })
      }).catch(() => {
      })
    },
    // 确认收货
    confirmGoods: function (item) {
      var _this = this
      Dialog.confirm({
        title: '确认信息',
        message: '是否确认收货',
        confirmButtonText: '确认',
        cancelButtonText: '返回'
      }).then(() => {
        userApi.confirmGoods(item.orderNum, item.status, item.orderId).then(function (res) {
          if (res.data.success === true) {
            let i
            switch (_this.orderStatus) {
              case 0:
                for (i = 0; i <= _this.list.length; i++) {
                  if (_this.list[i].orderName === item.orderName) {
                    item.status = 5
                    _this.onRefresh()
                    Toast.success('确认收货成功')
                    break
                  }
                }
                break
              case 4:
                for (i = 0; i <= _this.forReceiptGoodsList.length; i++) {
                  if (_this.forReceiptGoodsList[i].orderName === item.orderName) {
                    item.status = 5
                    _this.onRefresh()
                    Toast.success('确认收货成功')
                    break
                  }
                }
            }
          } else {
            _this.onRefresh()
            Toast.fail('确认收货成功')
          }
        })
      }).catch(() => {
      })
    },
    getOrderInfoList: function () {
      var _this = this
      var tempCurrentPage
      switch (_this.orderStatus) {
        case 0:
          _this.orderStatus = null
          tempCurrentPage = _this.currentPage.totalCurrentPage
          break
        case 1:
          tempCurrentPage = _this.currentPage.forPayCurrentPage
          break
        case 2:
          tempCurrentPage = _this.currentPage.haveCancelCurrentPage
          break
        case 3:
          tempCurrentPage = _this.currentPage.forSendCurrentPage
          break
        case 4:
          tempCurrentPage = _this.currentPage.forReceiptCurrentPage
          break
        case 5:
          tempCurrentPage = _this.currentPage.haveCompleteCurrentPage
          break
      }
      userApi.getOrderInfoList(tempCurrentPage, _this.pageSize, _this.orderStatus).then(function (res) {
        // res.data.re最后的值为订单的总条数
        if (!_this.orderStatus) {
          _this.orderStatus = 0
        }
        var temp = res.data.re
        if (temp !== null) {
          for (let i = 0; i < temp.length - 1; i++) {
            // 先判断订单的状态，再根据不同的值赋值给订单说明
            switch (_this.orderStatus) {
              case 0:
                switch (temp[i].status) {
                  case 1:
                    temp[i].statusDes = '待付款'
                    break
                  case 2:
                    temp[i].statusDes = '已取消'
                    break
                  case 3:
                    temp[i].statusDes = '待发货'
                    break
                  case 4:
                    temp[i].statusDes = '待收货'
                    break
                  case 5:
                    temp[i].statusDes = '已完成'
                    break
                }
                _this.list.push(temp[i])
                break
              case 1:
                temp[i].statusDes = '待付款'
                _this.forPayList.push(temp[i])
                break
              case 2:
                temp[i].statusDes = '已取消'
                _this.haveCancelList.push(temp[i])
                break
              case 3:
                temp[i].statusDes = '待发货'
                _this.forSendGoodsList.push(temp[i])
                break
              case 4:
                temp[i].statusDes = '待收货'
                _this.forReceiptGoodsList.push(temp[i])
                break
              case 5:
                temp[i].statusDes = '已完成'
                _this.haveCompletedList.push(temp[i])
                break
            }
          }
        }
        switch (_this.orderStatus) {
          case 0:
            _this.currentPage.totalCurrentPage = tempCurrentPage + 1
            break
          case 1:
            _this.currentPage.forPayCurrentPage = tempCurrentPage + 1
            break
          case 2:
            _this.currentPage.haveCancelCurrentPage = tempCurrentPage + 1
            break
          case 3:
            _this.currentPage.forSendCurrentPage = tempCurrentPage + 1
            break
          case 4:
            _this.currentPage.forReceiptCurrentPage = tempCurrentPage + 1
            break
          case 5:
            _this.currentPage.haveCompleteCurrentPage = tempCurrentPage + 1
            break
        }
        _this.loading = false
        if (res.data.re !== null) {
          switch (_this.orderStatus) {
            case 0:
              _this.OrderNum.totalOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum
              if (_this.list.length >= _this.OrderNum.totalOrderNum) {
                _this.finished.totalOrderFinished = true
              }
              break
            case 1:
              _this.OrderNum.forPayOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum

              if (_this.forPayList.length >= _this.OrderNum.forPayOrderNum) {
                _this.finished.forPayOrderFinished = true
              }
              break
            case 2:
              _this.OrderNum.haveCancelOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum
              if (_this.haveCancelList.length >= _this.OrderNum.haveCancelOrderNum) {
                _this.finished.haveCancelOrderFinished = true
              }
              break
            case 3:
              _this.OrderNum.forSendOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum
              if (_this.forSendGoodsList.length >= _this.OrderNum.forSendOrderNum) {
                _this.finished.forSendOrderFinished = true
              }
              break
            case 4:
              _this.OrderNum.forReceiptOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum
              if (_this.forReceiptGoodsList.length >= _this.OrderNum.forReceiptOrderNum) {
                _this.finished.forReceiptOrderFinished = true
              }
              break
            case 5:
              _this.OrderNum.haveCompleteOrderNum = res.data.re[res.data.re.length - 1].totalOrderNum
              if (_this.haveCompletedList.length >= _this.OrderNum.haveCompleteOrderNum) {
                _this.finished.haveCompleteOrderFinished = true
              }
              break
          }
        } else if (res.data.status === 0 || res.data.re === null) {
          switch (_this.orderStatus) {
            case 0:
              _this.finished.totalOrderFinished = true
              _this.list.push(0)
              _this.list.length = 0
              break
            case 1:
              _this.finished.forPayOrderFinished = true
              _this.forPayList.push(0)
              _this.forPayList.length = 0
              break
            case 2:
              _this.finished.haveCancelOrderFinished = true
              _this.haveCancelList.push(0)
              _this.haveCancelList.length = 0
              break
            case 3:
              _this.finished.forSendOrderFinished = true
              _this.forSendGoodsList.push(0)
              _this.forSendGoodsList.length = 0
              break
            case 4:
              _this.finished.forReceiptOrderFinished = true
              _this.forReceiptGoodsList.push(0)
              _this.forReceiptGoodsList.length = 0
              break
            case 5:
              _this.finished.haveCompleteOrderFinished = true
              _this.haveCompletedList.push(0)
              _this.haveCompletedList.length = 0
              break
          }
        }
      })
    }
  },
  components: {
    NavBar,
    EmptyData
  }
}
</script>
<style>
  .order-panel .van-cell__title {
    font-size: 12px;
  }
  .order-panel .van-cell__value {
    font-size: 12px;
  }
  .van-dialog__message {
    padding-top: 25px;
    padding-right: 25px;
    padding-bottom: 25px;
    padding-left: 25%;
    font-size: 16px;
    line-height: 1.5;
  }
  .empty-table .work-null[data-v-6c3551e3] {
    padding: 50px 0;
    text-align: center;
  }
</style>
